package com.maple.enumeration;

import lombok.Getter;

public enum ExceptionEnum {

    UPLOAD_FAILED(5000,"文件上传失败"),
    TOO_LARGE(5001, "文件大小过大"),
    TYPE_ERROR(5002, "文件类型错误"),

    vPASSWORD_ERROR(1001, "密码错误"),
    ACCOUNT_NOT_FOUND(1002, "账号不存在"),
    ACCOUNT_LOCKED(1003, "账号被锁定"),
    ALREADY_EXISTS(1004, "已存在"),
    USER_NOT_LOGIN(1005, "用户未登录"),
    LOGIN_FAILED(1006, "登录失败"),
    PASSWORD_EDIT_FAILED(1007, "密码修改失败"),
    OLD_PASSWORD_MISTAKE(1008, "旧密码错误"),

    CATEGORY_BE_RELATED_BY_SETMEAL(2001 ,"当前分类关联了套餐,不能删除"),
    CATEGORY_BE_RELATED_BY_DISH(2002, "当前分类关联了菜品,不能删除"),
    SETMEAL_ENABLE_FAILED(2003, "套餐内包含未启售菜品，无法启售"),
    DISH_BE_RELATED_BY_SETMEAL(2004, "当前菜品关联了套餐,不能删除"),
    DISH_ON_SALE(2006, "起售中的菜品不能删除"),
    SETMEAL_ON_SALE(2007, "起售中的套餐不能删除"),


    SHOPPING_CART_IS_NULL(3001, "购物车数据为空，不能下单"),
    ADDRESS_BOOK_IS_NULL(3002, "用户地址为空，不能下单"),
    ORDER_STATUS_ERROR(3003, "订单状态错误"),
    ORDER_NOT_FOUND(3004, "订单不存在"),
    ORDER_CONFIRMED(3005, "商家已接单"),


    NO_DEFAULT_ADDRESS_BOOK(10001, "没有默认地址"),

    UNKNOWN_ERROR(40000,"未知错误"),
    ALIPAY_ERROR(40001, "支付宝内部错误");

    @Getter
    private Integer code;
    @Getter
    private String  msg;

    private ExceptionEnum(Integer code, String msg){
        this.code = code;
        this.msg = msg;
    }
}
